<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.5"/>
<title>uartns550: Main Page</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="HTML_custom.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="xlogo_bg.png"/></td>
  <td style="padding-left: 0.5em;">
   <div id="projectname">uartns550
   </div>
   <div id="projectbrief">Vitis Drivers API Documentation</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.5 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li class="current"><a href="index.html"><span>Overview</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li><a href="globals.html"><span>APIs</span></a></li>
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="pages.html"><span>Examples</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('index.html','');});
</script>
<div id="doc-content">
<div class="header">
  <div class="headertitle">
<div class="title">uartns550 Documentation</div>  </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><p>This driver supports the following features in the Xilinx 16450/16550 compatible UART.</p>
<pre class="fragment">    - Dynamic data format (baud rate, data bits, stop bits, parity)
    - Polled mode
    - Interrupt driven mode
    - Transmit and receive FIFOs (16 bytes each for the 16550)
    - Access to the external modem control lines and the two discrete
    outputs
</pre><p>The only difference between the 16450 and the 16550 is the addition of transmit and receive FIFOs in the 16550.</p>
<p><b>Initialization &amp; Configuration</b></p>
<p>The <a class="el" href="struct_x_uart_ns550___config.html" title="This typedef contains configuration information for the device. ">XUartNs550_Config</a> structure is used by the driver to configure itself. This configuration structure is typically created by the tool-chain based on HW build properties.</p>
<p>To support multiple runtime loading and initialization strategies employed by various operating systems, the driver instance can be initialized in one of the following ways: </p>
<pre class="fragment">  - XUartNs550_Initialize(InstancePtr, DeviceId) - The driver looks
  up its own configuration structure created by the tool-chain based
  on an ID provided by the tool-chain.

  - XUartNs550_CfgInitialize(InstancePtr, CfgPtr, EffectiveAddr) - Uses a
  configuration structure provided by the caller. If running in a system
  with address translation, the provided virtual memory base address
  replaces the physical address present in the configuration structure.
</pre><p><b>Baud Rate</b></p>
<p>The UART has an internal baud rate generator that is clocked at a specified input clock frequency. Not all baud rates can be generated from some clock frequencies. The requested baud rate is checked using the provided clock for the system, and checked against the acceptable error range. An error may be returned from some functions indicating the baud rate was in error because it could not be generated.</p>
<p><b>Interrupts</b></p>
<p>The device does not have any way to disable the receiver such that the receive FIFO may contain unwanted data. The FIFOs are not flushed when the driver is initialized, but a function is provided to allow the user to reset the FIFOs if desired.</p>
<p>The driver defaults to no interrupts at initialization such that interrupts must be enabled if desired. An interrupt is generated for any of the following conditions.</p>
<ul>
<li>Transmit FIFO is empty</li>
<li>Data in the receive FIFO equal to the receive threshold</li>
<li>Data in the receiver when FIFOs are disabled</li>
<li>Any receive status error or break condition detected</li>
<li>Data in the receive FIFO for 4 character times without receiver activity</li>
<li>A change of a modem signal</li>
</ul>
<p>The application can control which interrupts are enabled using the SetOptions function.</p>
<p>In order to use interrupts, it is necessary for the user to connect the driver interrupt handler, <a class="el" href="group__uartns550.html#ga6e8579fcf317e1f30d61b4fb7fe60434" title="This function is the interrupt handler for the 16450/16550 UART driver. ">XUartNs550_InterruptHandler()</a>, to the interrupt system of the application. This function does not save and restore the processor context such that the user must provide it. A handler must be set for the driver such that the handler is called when interrupt events occur. The handler is called from interrupt context and is designed to allow application specific processing to be performed.</p>
<p>The functions, <a class="el" href="group__uartns550.html#ga421921af6a8df7c51ddbfa5d2301ad1b" title="This functions sends the specified buffer of data using the UART in either polled or interrupt driven...">XUartNs550_Send()</a> and <a class="el" href="group__uartns550.html#ga35fc171801e394fce29cbcb09dc1ff99" title="This function will attempt to receive a specified number of bytes of data from the UART and store it ...">XUartNs550_Recv()</a>, are provided in the driver to allow data to be sent and received. They are designed to be used in polled or interrupt modes.</p>
<dl class="section note"><dt>Note</dt><dd></dd></dl>
<p>The default configuration for the UART after initialization is:</p>
<ul>
<li>19,200 bps or XPAR_DEFAULT_BAUD_RATE if defined</li>
<li>8 data bits</li>
<li>1 stop bit</li>
<li>no parity</li>
<li>FIFO's are enabled with a receive threshold of 8 bytes</li>
</ul>
<pre>
MODIFICATION HISTORY:</pre><pre>Ver   Who  Date     Changes
</p>
<hr/>
<p>
1.00a ecm  08/16/01 First release
1.00b jhl  03/11/02 Repartitioned the driver for smaller files.
1.01a jvb  12/14/05 I separated dependency on the static config table and
                    xparameters.h from the driver initialization by moving
                    _Initialize and _LookupConfig to _sinit.c. I also added
                    the new _CfgInitialize routine.
1.11a sv   03/20/07 Updated to use the new coding guidelines.
1.11a sv   07/25/08 Corrected the definitions of XUN_MODEM_DCD_DELTA_MASK
                      and XUN_MODEM_DCD_MASK.
1.12a sdm  08/22/08 Removed support for static interrupt handlers from the MDD
              file
1.12a sdm  12/15/08 Deprecated the CLOCK_HZ parameter in mdd and updated the
              Tcl to obtain the bus frequency during libgen
1.13a sdm  07/10/09 a) Updated the driver Tcl to obtain the external clock
                       frequency from MHS, when C_HAS_EXTERNAL_XIN = 1.
                    b) Added receive line interrupt option to OptionsTable[]
                       in <a class="el" href="xuartns550__options_8c.html">xuartns550_options.c</a>
2.00a ktn  10/20/09 Converted all register accesses to 32 bit access.
              Updated to use HAL Processor APIs. _m is removed from the
              name of all the macro definitions. XUartNs550_mClearStats
              macro is removed, XUartNs550_ClearStats function should be
              used in its place.
2.01a bss  01/13/12 Updated the XUartNs550_SelfTest to use Xil_AssertNonvoid
              in place of XASSERT_NONVOID for CR 641344.
                      Removed unnecessary read of the LCR register in the
                    XUartNs550_CfgInitialize function. Removed compiler
              warnings for unused variables in the
              XUartNs550_StubHandler.
2.02a adk 09/16/13 Fixed CR:735289 changes are made in the <a class="el" href="xuartns550__intr_8c.html">xuartns550_intr.c</a>
             file.
3.0   adk  19/12/13 Updated as per the New Tcl API's
3.1   adk  20/08/14 Fixed CR:816989 Canonical Definition for Multiple
                      Instances of UARTSNS550 have the same Device Id.
              Changes are made in the driver tcl file.
3.2   adk  15/10/14 Fixed CR:824444 changes are made in the example file
              <a class="el" href="xuartns550__intr__example_8c.html" title="This file contains a design example using the UART 16450/16550 driver (XUartNs550) and hardware devic...">xuartns550_intr_example.c</a>.
3.2   adk 15/10/14  Fixed CR:826435 changes are made in the driver tcl file.
3.3     nsk  04/13/15 Fixed CR:857013 changes are made in <a class="el" href="xuartns550_8c.html">xuartns550.c</a> and
              <a class="el" href="xuartns550__l_8c.html">xuartns550_l.c</a>.
3.4   sk   11/10/15 Used UINTPTR instead of u32 for Baseaddress CR# 867425.
                    Changed the prototype of XUartNs550_CfgInitialize API.
      ms   01/23/17 Added xil_printf statement in main function for all
                    examples to ensure that "Successfully ran" and "Failed"
                    strings are available in all examples. This is a fix
                    for CR-965028.
      ms   03/17/17 Added readme.txt file in examples folder for doxygen
                    generation.
3.5   ms   04/18/17 Modified tcl file to add suffix U for all macros
                    definitions of uartns550 in xparameters.h
3.9   gm   07/09/23 Added SDT support
3.12  adk  06/02/25 Since PLM has custom implementation of outbyte() API
                    don't pull it for PLM template app case.
</pre> </div></div><!-- contents -->
</div><!-- doc-content -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
	<p class="footer">&copy; Copyright 2015-2022 Xilinx, Inc. All Rights Reserved.</p>
	<p class="footer">&copy; Copyright 2022-2023 Advanced Micro Devices, Inc. All Rights Reserved.</p>
</div>
</body>
</html>
